{% extends "miramar/base.html" %}
{% load i18n %}
{% load miramar_tags %}
{% block title %}{% trans "Stored files" %}{% endblock %}
{% block content_title %}<h1>{% trans "Stored files" %}</h1>{% endblock %}
{% block content %}
<table class="module">
    <caption>{% trans "Stored files" %}</caption>
    <thead>
        <tr>
            <th>{% trans "Title" %}</th>
            <th>{% trans "URL stub" %}</th>
            <th>{% trans "Type" %}</th>
            <th>{% trans "Size" %}</th>
            <th>{% trans "Download" %}</th>
            <th>{% trans "Delete" %}</th>
        </tr>
    </thead>
    <tbody>
        {% for storedfile in page_obj.object_list %}
        <tr>
            <td><a href="{% url miramar_storedfile_update storedfile.slug %}">{{ storedfile.title }}</a></td>
            <td>{{ storedfile.slug }}</td>
            <td>{{ storedfile.file.size|filesizeformat }}</td>
            <td>{{ storedfile.get_file_type }}</td>
            <td><a href="{{ storedfile.get_absolute_url }}">{% trans "Download" %}</a></td>
            <td><a href="{% url miramar_storedfile_delete storedfile.slug %}">{% trans "Delete" %}</a></td>
        </tr>
        {% empty %}
        <tr>
            <td colspan="6"><em>{% trans "There are no stored files." %}</em></td>
        </tr>
        {% endfor %}
    </tbody>
    <tfoot>
        <tr>
            <td colspan="6">
            <p>
            {% if page_obj.has_previous %}
            <a href="{% url miramar_storedfile_list %}?page={{ page_obj.previous_page_number }}">&lt; {% trans "Previous page" %}</a> | 
            {% endif %}
            {% blocktrans with paginator.num_pages as num_pages and page_obj.number as number %}Page {{ number }} of {{ num_pages }}{% endblocktrans %}
            {% if page_obj.has_next %}
            <a href="{% url miramar_storedfile_list %}?page={{ page_obj.next_page_number }}">{% trans "Next" %}&gt;</a>
            {% endif %}
            </p>
            </td>
        </tr>
    </tfoot>
</table>
{% endblock %}
